{extend name="Teacher/nav"} {block name="title"}消息中心{/block} {block name="content"}

<body>
    <div class="row">
        <div class="col-md-12">
            <div class="panel-group" id="message">
                <div class="panel panel-primary">
                    <div class="panel-heading">
                        <h4 class="panel-title">
                            <a class="accordion-toggle collapsed" data-toggle="collapse" data-target="#my" style="text-decoration:none;">
                                我的换课申请&nbsp;
                                {eq name="my_number" value="0"}
                                {else/}
                                <!-- 红圈数字 -->
                                <span class="badge">{$my_number}</span>
                                {/eq}&nbsp;&nbsp;&nbsp;&nbsp; 
                              <span class="glyphicon glyphicon-chevron-down"></span>
                            </a>
                        </h4>
                    </div>
                    <div class="panel-collapse collapse in table-responsive" id="my">        
                         <table class="table table-hover table-striped">
                                <tr>
                                    <th class="text-center">阅读状态</th>
                                    <th class="text-center">申请者时刻表</th>
                                    <th class="text-center">目标时刻表</th>
                                    <th class="text-center">状态</th>
                                    <th class="text-center">时间</th>
                                    <th class="text-center">操作</th>
                                </tr>
                                {volist name="applyMessages" id="applyMessage" key="key"}
                                <tr>
                                    <td class="text-center" width="5%" style="font-size: 20px;">
                                        {eq name="applyMessage->isReadStatus" value="0"}
                                        <span class="glyphicon glyphicon-envelope" style="color:orange;"></span> {else/}
                                        <span class="glyphicon glyphicon-envelope" style="color:gray;"></span> {/eq}
                                    </td>
                                    <td class="text-center" width="25%">
                                        教师：{$applyMessage->getApplyTeacher()->name}<br />
                                        课程：{$applyMessage->getApplyCourse()->name}<br />
                                        时间：第{$applyMessage->getApply()->weekorder}周 星期{$applyMessage->getApply()->week} 第{$applyMessage->getApply()->node}节<br />
                                        教室：{$applyMessage->getApply()->classroom->name}<br />    
                                    </td>
                                    <td class="text-center" width="25%">
                                        教师：{$applyMessage->getTargetTeacher()->name}<br />
                                        课程：{$applyMessage->getTargetCourse()->name}<br />
                                        时间：第{$applyMessage->getTarget()->weekorder}周 星期{$applyMessage->getTarget()->week} 第{$applyMessage->getTarget()->node}节<br />
                                        教室：{$applyMessage->getTarget()->classroom->name}<br />      
                                    </td>
                                    <td class="text-center" width="10%">{$applyMessage->isAgreeStatus}</td>
                                    <td class="text-center" width="15%">{$applyMessage->create_time}</td>
                                    <td class="text-center" width="20%">
                                        <a href="{:url('handleRead', ['request' => 1,'id' => " $applyMessage->id"])}" class="btn btn-md {eq name="applyMessage->isReadStatus" value="0"}btn-primary{else/}btn-default disabled{/eq}"><i class="glyphicon glyphicon-check">&nbsp;已读</i></a>
                                        <a href="{:url('handleRead', ['request' => 0,'id' => " $applyMessage->id"])}" class="btn btn-md btn-danger"><i class="glyphicon glyphicon-trash">&nbsp;删除</i></a>
                                    </td>
                                </tr>
                                {/volist}
                         </table>
                         {:$applyMessages->render()}
                    </div>
                </div>
                <div class="panel panel-primary">
                    <div class="panel-heading">
                        <h4 class="panel-title">
                            <a class="accordion-toggle collapsed in table-responsive" data-toggle="collapse" data-target="#other" style="text-decoration:none;">
                                谁向我换课&nbsp;
                                {eq name="other_number" value="0"}
                                {else/}
                                <!-- 右上角红圈数字 -->
                                <span class="badge">{$other_number}</span>
                                {/eq}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                <span class="glyphicon glyphicon-chevron-down"></span>  
                            </a>
                        </h4>
                    </div>
                    <div class="panel-collapse collapse in" id="other">
                        <table class="table table-hover table-striped">
                                <tr>
                                    <th class="text-center">阅读状态</th>
                                    <th class="text-center">申请者时刻表</th>
                                    <th class="text-center">目标时刻表</th>
                                    <th class="text-center">状态</th>
                                    <th class="text-center">时间</th>
                                    <th class="text-center">操作</th>
                                </tr>
                                {volist name="requestMessages" id="requestMessage" key="key"}
                                <tr>
                                    <td class="text-center" width="5%">
                                        {eq name="requestMessage->isReadStatus" value="0"}
                                        <span class="glyphicon glyphicon-envelope" style="color:orange;"></span> {else/}
                                        <span class="glyphicon glyphicon-envelope" style="color:gray;"></span> {/eq}
                                    </td>
                                    <td class="text-center" width="25%">
                                        教师：{$requestMessage->getApplyTeacher()->name}<br />
                                        课程：{$requestMessage->getApplyCourse()->name}<br />
                                        时间：第{$requestMessage->getApply()->weekorder}周 星期{$requestMessage->getApply()->week} 第{$requestMessage->getApply()->node}节<br /> 
                                        教室：{$requestMessage->getApply()->classroom->name}<br />
                                    </td>
                                    <td class="text-center" width="25%">
                                        教师：{$requestMessage->getTargetTeacher()->name}<br />
                                        课程：{$requestMessage->getTargetCourse()->name}<br />
                                        时间：第{$requestMessage->getTarget()->weekorder}周 星期{$requestMessage->getTarget()->week} 第{$requestMessage->getTarget()->node}节<br />
                                        教室：{$requestMessage->getTarget()->classroom->name}<br />    
                                    </td>
                                    <td class="text-center" width="10%">{$requestMessage->isAgreeStatus}</td>
                                    <td class="text-center" width="15%">{$requestMessage->create_time}</td>
                                    <td class="text-center" width="20%">
                                        {eq name="requestMessage->getData('isAgreeStatus')" value="0"}
                                        <a href="{:url('handlemessage', ['request' => 1,'id' => " $requestMessage->id"])}" class="btn btn-md btn-primary">
                                              <i class="glyphicon glyphicon-ok" aria-hidden="true">&nbsp;同意</i>
                                           </a>&nbsp;
                                        <a href="{:url('handlemessage', ['request' => 0,'id' => " $requestMessage->id"])}" class="btn btn-md btn-primary">
                                              <i class="glyphicon glyphicon-remove" aria-hidden="true">&nbsp;拒绝</i>
                                           </a>
                                        <a href="{:url('handleRead', ['request' => 0,'id' => " $requestMessage->id"])}" class="btn btn-md btn-default disabled"><i class="glyphicon glyphicon-trash">&nbsp;删除</i></a> {else/}
                                        <a href="{:url('handlemessage', ['request' => 1,'id' => " $requestMessage->id"])}" class="btn btn-md btn-default disabled">
                                              <i class="glyphicon glyphicon-ok" aria-hidden="true">&nbsp;同意</i>
                                              </a>&nbsp;
                                        <a href="{:url('handlemessage', ['request' => 0,'id' => " $requestMessage->id"])}" class="btn btn-md btn-default disabled" style="color: gray;">
                                              <i class="glyphicon glyphicon-remove" aria-hidden="true">&nbsp;拒绝</i>
                                              </a>
                                        <a href="{:url('handleRead', ['request' => 0,'id' => " $requestMessage->id"])}" class="btn btn-md btn-danger"><i class="glyphicon glyphicon-trash">&nbsp;删除</i></a> {/eq}
                                    </td>
                                </tr>
                                {/volist}
                        </table>
                        {:$requestMessages->render()}
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
{/block}